package com.abel.day0312;

import java.util.Stack;

/**
 * @author xiachao
 * @date 2019/3/12
 */
public class Solution {

    public int NumberOf1(int n) {
        int count = 0;
        while(n!=0){
            if((n&1) == 1){
                count++;
            }
            n >>=1;
        }
        return count;
    }

    Stack<Integer> stack1 = new Stack<Integer>();
    Stack<Integer> stack2 = new Stack<Integer>();

    public void push(int node) {
        stack1.add(node);
        String str = "ss";
        int [] array = new int[100];
        for(int i=0;i<str.length();i++){
            array[(int)str.charAt(i) - 65]++;
        }
    }

    public int pop() {
        while(!stack1.isEmpty()){
            stack2.add(stack1.pop());
        }
        Integer n = stack2.pop();
        while(!stack2.isEmpty()){
            stack1.add(stack2.pop());
        }
        return n;
    }

    public static void main(String[] args) {
        System.out.println(new Solution().NumberOf1(7));
    }

}
